using System;
using System.Collections.Generic;
using System.Text;
using TrainTicket.DAO;
using TrainTicket.VO;
using System.Data;

namespace TrainTicket.TRAIN
{
    public class TicketTRAIN
    {
        private TicketDAO _ticketDAO;

        public TicketTRAIN()
        {
            _ticketDAO = new TicketDAO();
        }

        public DataTable GetAllTicket()
        {
            return _ticketDAO.GetAllTicket();
        }

        public DataTable Reports(DateTime dateStart, DateTime dateEnd, string groupBy, string status)
        {
            return _ticketDAO.Reports(dateStart, dateEnd, groupBy, status);    
        }

        public DataTable GetTicketById(int ticketNo)
        {
            return _ticketDAO.GetTicketById(ticketNo);
        }

        public DataTable GetTotalFeesByYear(string year)
        {
            return _ticketDAO.GetTotalFeesByYear(year);
        }

        public DataTable GetTotalOrderByCustomer(string year)
        {
            return _ticketDAO.GetTotalOrderByCustomer(year);
        }

        public DataTable GetAllTicketBySearch(string customer, DateTime date, string status)
        {
            return _ticketDAO.GetAllTicketBySearch(customer, date, status);
        }

        public DataTable GetAllTicketPending()
        {
            return _ticketDAO.GetAllTicketPending();
        }

        public int InsertTicketCustomer(Ticket ticket)
        {
            return _ticketDAO.InsertTicketCustomer(ticket);
        }

        public int InsertTicket(Ticket ticket)
        {
            return _ticketDAO.InsertTicket(ticket);
        }

        public int UpdateStatusTicket(int ticketNo, string status, int accountID)
        {
            return _ticketDAO.UpdateStatusTicket(ticketNo, status, accountID);
        }

        public int UpdateStatusTicketReturn(int ticketNo, string status, float fareReturnCustomer, int listBusID, string numberSeat, int accountID)
        {
            return _ticketDAO.UpdateStatusTicketReturn(ticketNo, status, fareReturnCustomer, listBusID, numberSeat, accountID);
        }

        public int GetTotalOrder()
        {
            return _ticketDAO.GetTotalOrder();
        }

        public float GetTotalSales()
        {
            return _ticketDAO.GetTotalSales();
        }

        public int DeleteTicket(int id)
        {
            return _ticketDAO.DeleteTicket(id);
        }
    }
}
